package cn.brilliantfuture.commentry.entity;

// Generated 2011-11-3 13:34:34 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;

/**
 * ProductBatch generated by hbm2java
 */
@Entity
@Table(name = "product_batch", catalog = "cabinet")
public class ProductBatch implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer productBatchId;
	private OrderInformation orderInformation;
	private Integer insertUser;
	private StorageGrid storageGrid;
	private String rfidSn;
	private Integer status;
	private boolean print;
	private String passwd;
	private Integer storageGridPurchaserNewsId;
	private Date insertTime;
	private boolean deleted;
	// 存储类型 1 普通 2 保温 3 温控
	private Integer storeMode = 1;
	// 温控类型
	private DataModels dataModels;
	// 温控范围
	private String dataModelValue;
	private DeliveryPlan deliveryPlan;

	public ProductBatch() {
	}

	public ProductBatch(boolean print, boolean deleted) {
		this.print = print;
		this.deleted = deleted;
	}

	public ProductBatch(OrderInformation orderInformation, Integer insertUser,
			StorageGrid storageGrid, 
			String rfidSn, Integer status, boolean print, String passwd,
			Integer storageGridPurchaserNewsId, Date insertTime, boolean deleted) {
		this.orderInformation = orderInformation;
		this.insertUser = insertUser;
		this.storageGrid = storageGrid;
		this.rfidSn = rfidSn;
		this.status = status;
		this.print = print;
		this.passwd = passwd;
		this.storageGridPurchaserNewsId = storageGridPurchaserNewsId;
		this.insertTime = insertTime;
		this.deleted = deleted;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "product_batch_id", unique = true, nullable = false)
	public Integer getProductBatchId() {
		return this.productBatchId;
	}

	public void setProductBatchId(Integer productBatchId) {
		this.productBatchId = productBatchId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "order_information_id")
	public OrderInformation getOrderInformation() {
		return this.orderInformation;
	}

	public void setOrderInformation(OrderInformation orderInformation) {
		this.orderInformation = orderInformation;
	}

	@Column(name = "insert_user")
	public Integer getInsertUser() {
		return this.insertUser;
	}

	public void setInsertUser(Integer insertUser) {
		this.insertUser = insertUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "storage_grid_id")
	public StorageGrid getStorageGrid() {
		return this.storageGrid;
	}

	public void setStorageGrid(StorageGrid storageGrid) {
		this.storageGrid = storageGrid;
	}

	@Column(name = "rfid_sn", length = 45)
	@Length(max = 45)
	public String getRfidSn() {
		return this.rfidSn;
	}

	public void setRfidSn(String rfidSn) {
		this.rfidSn = rfidSn;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "print", nullable = false)
	public boolean isPrint() {
		return this.print;
	}

	public void setPrint(boolean print) {
		this.print = print;
	}

	@Column(name = "passwd", length = 50)
	@Length(max = 50)
	public String getPasswd() {
		return this.passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	@Column(name = "storage_grid_purchaser_news_id")
	public Integer getStorageGridPurchaserNewsId() {
		return this.storageGridPurchaserNewsId;
	}

	public void setStorageGridPurchaserNewsId(Integer storageGridPurchaserNewsId) {
		this.storageGridPurchaserNewsId = storageGridPurchaserNewsId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", length = 19)
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "deleted", nullable = false)
	public boolean isDeleted() {
		return this.deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "data_models_id")
	public DataModels getDataModels() {
		return dataModels;
	}

	public void setDataModels(DataModels dataModels) {
		this.dataModels = dataModels;
	}

	@Column(name = "data_model_value")
	public String getDataModelValue() {
		return dataModelValue;
	}

	public void setDataModelValue(String dataModelValue) {
		this.dataModelValue = dataModelValue;
	}

	@Column(name = "store_mode")
	public Integer getStoreMode() {
		return storeMode;
	}

	public void setStoreMode(Integer storeMode) {
		this.storeMode = storeMode;
	}

	@OneToOne(optional = true, mappedBy = "productBatch")
	public DeliveryPlan getDeliveryPlan() {
		return deliveryPlan;
	}

	public void setDeliveryPlan(DeliveryPlan deliveryPlan) {
		this.deliveryPlan = deliveryPlan;
	}

}
